#ifndef FTPCLIENT_H
#define FTPCLIENT_H

#include <QObject>
#include <QDebug>
#include <QFile>
#include <QFtp>
#include <QUrl>
#include <QDir>

class FtpClient : public QObject
{
    Q_OBJECT
public:
    explicit FtpClient(QObject *parent = 0);
    void    setHost(const QString &host);
    void    setUserName(const QString &userName);
    void    setPassword(const QString &password);
    void    setPath(const QString &path);
    void    setFilename(const QString &name);
    
signals:
    void    finishedUpload(bool error);
    
public slots:
    void    startUpload();
    void    ftpCommandFinished(int commandId,bool error);

private:
    QFtp    *qFtpClient;
    bool    ready;
    QUrl    qUrl;
    QString fileName;
    
    void    connectToServer();
    void    uploadFileToServer();
};

#endif // FTPCLIENT_H
